From: Florian Müllner Date: Thu, 4 Oct 2018 17:11:05 +0000 (+0200) Subject: app: Don't rely on app menu to check for GtkApplications X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2^2~9 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e355756758c362d964cca37ded6e5a09cc846a8a;p=gnome-shell.git app: Don't rely on app menu to check for GtkApplications As the app menu is being phased out, it is no longer a good indicator for GtkApplications. Instead, base the check directly on the appropriate D-Bus properties. https://gitlab.gnome.org/GNOME/gnome-shell/issues/624 --- diff --git a/src/shell-app.c b/src/shell-app.c index 108bb4d11..c765800dc 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -602,6 +602,7 @@ gboolean shell_app_can_open_new_window (ShellApp *app) { ShellAppRunningState *state; + MetaWindow *window; /* Apps that are not running can always open new windows, because activating them would open the first one */ @@ -635,11 +636,13 @@ shell_app_can_open_new_window (ShellApp *app) Activate() knows nothing about the other instances, so it will show a new window. */ - if (state->remote_menu) + + window = state->windows->data; + + if (state->unique_bus_name != NULL && + meta_window_get_gtk_application_object_path (window) != NULL) { - const char *application_id; - application_id = meta_window_get_gtk_application_id (state->windows->data); - if (application_id != NULL) + if (meta_window_get_gtk_application_id (window) != NULL) return FALSE; else return TRUE;